using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace WinAppTest
{


    public partial class Controla1 : UserControl
    {
        public Controla1()
        {
            InitializeComponent();
        }

        [Description("Setting for Logging functionality")]
       public string LoggingSetting {
           get { return "Miiika"; }
           set { }
       }


        protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
        {
            
            //you must use this control inside a container, eg. windows form to be able to use design mode for this usercontrol
            if (this.DesignMode)
            {
                e.Graphics.DrawString("try to change bgcolor in properties", new Font(FontFamily.GenericMonospace, 14), new SolidBrush(Color.Blue), 5, 5);
              
            }
        }

        private void Controla1_MouseCaprture(object sender, EventArgs e)
        {
            if (this.DesignMode)
            {
                MessageBox.Show("mouse is captured");
            }
        }

        private void Controla1_BackColorChanged(object sender, EventArgs e)
        {
            if (this.DesignMode)
            {
                EnvDTE.DTE dte;
                dte = (EnvDTE.DTE)System.Runtime.InteropServices.Marshal.GetActiveObject("VisualStudio.DTE.8.0");
                dte.ActiveDocument.ReplaceText("Adrijan Mutu", "Adrijan Mutu", 0);
                //string s = dte.ActiveDocument.MarkText(VladaGenerator.GetEvent(sender.ItemName), 0);
                //dte.ActiveDocument.ReplaceText(s, VladaGenerator.GenerateEvent(""), 0);


            }           
        }
    }
}